# Automatically Generated Makefile by EDE.
# For use with: make
#
# DO NOT MODIFY THIS FILE OR YOUR CHANGES MAY BE LOST.
# EDE is the Emacs Development Environment.
# http://cedet.sourceforge.net/ede.shtml
#

top=
ede_FILES=Project.ede Makefile

Misc_AUX=ChangeLog
EMACS=emacs
LOADPATH= ../common/  ../ede/ ../semantic/ ../eieio/\
    ../speedbar/ ../semantic/bovine/ ../semantic/wisent/
LOADDEFS=srecode-loaddefs.el
LOADDIRS=.
lang_SEMANTIC_GRAMMAR=srecode-template.wy
lang_SEMANTIC_GRAMMAR_EL=srecode-template-wy.el
srecode_LISP=srecode.el srecode-mode.el srecode-compile.el srecode-insert.el srecode-template-mode.el srecode-semantic.el srecode-load.el srecode-template.el srecode-dictionary.el srecode-args.el srecode-table.el srecode-filters.el srecode-find.el srecode-ctxt.el srecode-getset.el srecode-cpp.el srecode-expandproto.el srecode-el.el srecode-srt.el srecode-texi.el srecode-map.el srecode-extract.el srecode-java.el srecode-fields.el srecode-android.el srecode-m3.el
EMACSFLAGS=-batch --no-site-file
ELISPPRELOAD= cedet-compat
doc_TEXINFOS=srecode.texi
MAKEINFO=makeinfo
tests_LISP=srecode-test.el srecode-test-getset.el
document_LISP=srecode-document.el srecode-document-vars.el
VERSION=1.1
DISTDIR=$(top)srecode-$(VERSION)



all: autoloads lang srecode srecode.info tests document templates

.PHONY: autoloads
autoloads: 
	@echo "(add-to-list 'load-path nil)" > $@-compile-script
	for loadpath in . ${LOADPATH}; do \
	   echo "(add-to-list 'load-path \"$$loadpath\")" >> $@-compile-script; \
	done;
	@echo "(require 'cedet-autogen)" >> $@-compile-script
	"$(EMACS)" -batch --no-site-file -l $@-compile-script -f cedet-batch-update-autoloads $(LOADDEFS) $(LOADDIRS)

.PHONY: lang
lang: $(lang_SEMANTIC_GRAMMAR)
	@echo "(add-to-list 'load-path nil)" > grammar-make-script
	@for loadpath in . ${LOADPATH}; do \
	   echo "(add-to-list 'load-path \"$$loadpath\")" >> grammar-make-script; \
	done;
	@echo "(require 'semantic-load)" >> grammar-make-script
	@echo "(require 'semantic-grammar)" >> grammar-make-script
	"$(EMACS)" -batch --no-site-file -l grammar-make-script -f semantic-grammar-batch-build-packages $^

.PHONY: srecode
srecode: $(srecode_LISP)
	@echo "(add-to-list 'load-path nil)" > $@-compile-script
	for loadpath in . ${LOADPATH}; do \
	   echo "(add-to-list 'load-path \"$$loadpath\")" >> $@-compile-script; \
	done;
	for preload in ${ELISPPRELOAD}; do \
	   echo "(load \"$$preload\")" >> $@-compile-script; \
	done;
	@echo "(setq debug-on-error t)" >> $@-compile-script
	"$(EMACS)" $(EMACSFLAGS) -l $@-compile-script -f batch-byte-compile $^

srecode.info: $(doc_TEXINFOS)
	$(MAKEINFO) $<

.PHONY: tests
tests: $(tests_LISP)
	@echo "(add-to-list 'load-path nil)" > $@-compile-script
	for loadpath in . ${LOADPATH}; do \
	   echo "(add-to-list 'load-path \"$$loadpath\")" >> $@-compile-script; \
	done;
	for preload in ${ELISPPRELOAD}; do \
	   echo "(load \"$$preload\")" >> $@-compile-script; \
	done;
	@echo "(setq debug-on-error t)" >> $@-compile-script
	"$(EMACS)" $(EMACSFLAGS) -l $@-compile-script -f batch-byte-compile $^

.PHONY: document
document: $(document_LISP)
	@echo "(add-to-list 'load-path nil)" > $@-compile-script
	for loadpath in . ${LOADPATH}; do \
	   echo "(add-to-list 'load-path \"$$loadpath\")" >> $@-compile-script; \
	done;
	for preload in ${ELISPPRELOAD}; do \
	   echo "(load \"$$preload\")" >> $@-compile-script; \
	done;
	@echo "(setq debug-on-error t)" >> $@-compile-script
	"$(EMACS)" $(EMACSFLAGS) -l $@-compile-script -f batch-byte-compile $^

.PHONY:templates
templates:
	$(MAKE) -C templates

tags: 
	$(MAKE) -C templates/ $(MFLAGS) $@


clean:
	rm -f *.elc *.html *.info*

.PHONY: dist

dist: autoloads $(lang_SEMANTIC_GRAMMAR_EL) srecode.info
	mkdir $(DISTDIR)
	cp $(Misc_AUX) srecode-loaddefs.el $(lang_SEMANTIC_GRAMMAR) $(lang_SEMANTIC_GRAMMAR_EL) $(srecode_LISP) $(doc_TEXINFOS) srecode.info* $(tests_LISP) $(document_LISP) $(ede_FILES) $(DISTDIR)
	$(MAKE) -C templates $(MFLAGS) DISTDIR=$(DISTDIR)/templates dist

Makefile: Project.ede
	@echo Makefile is out of date!  It needs to be regenerated by EDE.
	@echo If you have not modified Project.ede, you can use 'touch' to update the Makefile time stamp.
	@false



# End of Makefile
